<?
function GetAll()
{
        $conn = getConnection();
        //print_r($conn);
        return $conn->query('SELECT * FROM 2011_Tools JOIN 2011_Books');
}
function GetAllT()
{
        $conn = getConnection();
        //print_r($conn);
        return $conn->query('SELECT * FROM 2011_Tools');
}
function GetAllB()
{
        $conn = getConnection();
        //print_r($conn);
        return $conn->query('SELECT * FROM 2011_Books');
}


function GetT($id)
{
        $conn = getConnection();
        $result = $conn->query("SELECT * FROM 2011_Tools WHERE id=$id");
        $rs = $result->fetch_assoc();        
        $conn->close();
        return $rs;
}
function GetB($id)
{
        $conn = getConnection();

        $result = $conn->query("SELECT * FROM 2011_Books WHERE id=$id");
        $rs = $result->fetch_assoc();
        
        $conn->close();
        return $rs;
}